package com.example.medicine.View;


import com.example.medicine.Bean.mingyi;
import com.example.medicine.Mapper.myxxMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class MyxxView {
    @Autowired
    private myxxMapper myxxMapper;

    @RequestMapping("/myxx/create")
    public String myxxCreateShow(){
        return "pages/myxx/create";
    }

    @RequestMapping("/myxx/edit/{id}")
    public String getMyxxById(@PathVariable int id, Model model){
        mingyi mingyi=myxxMapper.getById(id);
        mingyi.setId(id);
        model.addAttribute("myxx",mingyi);
        return "pages/myxx/edit";
    }
    @RequestMapping("/myxx/batchAdd")
    public String batchAdd(){
        return "pages/myxx/batchAdd";
    }
}

